package com.example.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.entity.SysEmail;
import com.example.handler.SysEmailHandler;
import com.example.mapper.SysEmailMapper;
import com.example.service.SysEmailService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class SysEmailServiceImpl extends ServiceImpl<SysEmailMapper, SysEmail> implements SysEmailService {

    @Resource
    private SysEmailHandler sysEmailHandler;

    @Override
    public void sendEmail(SysEmail sysEmail) {
        this.save(sysEmail);
        sysEmailHandler.send(sysEmail);
    }
}
